package com.cskaoyan.config;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

/**
 * @author stone
 * @date 2022/09/01 14:55
 */
public class ApplicationInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
    //ContextLoaderListener加载的配置类
    @Override
    protected Class<?>[] getRootConfigClasses() {
        return new Class[]{SpringConfiguration.class};
    }

    // DispatcherServlet加载的配置类
    @Override
    protected Class<?>[] getServletConfigClasses() {
        return new Class[]{MvcConfiguration.class};
    }

    // 配置DispatcherServlet的映射范围 →  /
    @Override
    protected String[] getServletMappings() {
        String[] mappings = {"/"};
        return mappings;
    }
}
